package com.aynu.webshop.web.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.aynu.webshop.core.generic.GenericDao;
import com.aynu.webshop.core.generic.GenericServiceImpl;
import com.aynu.webshop.web.dao.OrderdetailMapper;
import com.aynu.webshop.web.model.Orderdetail;
import com.aynu.webshop.web.service.OrderdetailService;
@Service
public class OrderdetailServiceImpl extends GenericServiceImpl<Orderdetail, Integer> implements OrderdetailService {

	@Resource
	private OrderdetailMapper orderdetailMapper;
	
	@Override
	public int insert(Orderdetail model) {
		// TODO Auto-generated method stub
		return orderdetailMapper.insertSelective(model);
	}

	@Override
	public int update(Orderdetail model) {
		// TODO Auto-generated method stub
		return orderdetailMapper.updateByPrimaryKeySelective(model);
	}

	@Override
	public int delete(Integer id) {
		// TODO Auto-generated method stub
		return orderdetailMapper.deleteByPrimaryKey(id);
	}

	@Override
	public Orderdetail selectById(Integer id) {
		// TODO Auto-generated method stub
		return orderdetailMapper.selectByPrimaryKey(id);
	}

	@Override
	public Orderdetail selectOne() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Orderdetail> selectList() {
		// TODO Auto-generated method stub
		return orderdetailMapper.findAll();
	}

	@Override
	public GenericDao<Orderdetail, Integer> getDao() {
		// TODO Auto-generated method stub
		return orderdetailMapper;
	}

	@Override
	public List<Orderdetail> selectByOId(Integer oid) {
		// TODO Auto-generated method stub
		return orderdetailMapper.findDetailByOid(oid);
	}

}
